Azure Container Deploy Pipe - 'ServiceTag' is not valid value for enum <enum 'IpFilterTag'>
Asked by David Harper:

Hi,

I'm currently trying to deploy using \`atlassian/azure-web-apps-containers-deploy:1.1.0\` to an Azure Linux App Service for Containers.

If I run in the Pipeline it logs in fine using a Service Principal but then I get the error:  
\`\`\`  
INFO: Starting deployment to Azure App Service...  
az webapp config container set {params-redacted}  
ERROR: 'ServiceTag' is not valid value for enum <enum 'IpFilterTag'>  
Traceback (most recent call last):  
File "/usr/local/lib/python3.6/site-packages/msrest/serialization.py", line 908, in serialize_enum  
enum_obj(result)  
File "/usr/local/lib/python3.6/enum.py", line 291, in __call__  
return cls.__new__(cls, value)  
File "/usr/local/lib/python3.6/enum.py", line 533, in __new__  
return cls._missing_(value)  
File "/usr/local/lib/python3.6/enum.py", line 546, in _missing_  
raise ValueError("%r is not a valid %s" % (value, cls.__name__))  
ValueError: 'ServiceTag' is not a valid IpFilterTag  
During handling of the above exception, another exception occurred:  
Traceback (most recent call last):  
File "/usr/local/lib/python3.6/site-packages/knack/cli.py", line 206, in invoke  
cmd_result = self.invocation.execute(args)  
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 328, in execute  
raise ex  
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 386, in _run_jobs_serially  
results.append(self._run_job(expanded_arg, cmd_copy))  
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 379, in _run_job  
six.reraise(*sys.exc_info())  
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise  
raise value  
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 356, in _run_job  
result = cmd_copy(params)  
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 171, in __call__  
return self.handler(*args, **kwargs)  
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 441, in default_command_handler  
return op(**command_args)  
File "/usr/local/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 798, in update_container_settings  
_add_fx_version(cmd, resource_group_name, name, docker_custom_image_name, slot)  
File "/usr/local/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 578, in _add_fx_version  
linux_fx_version=linux_fx, windows_fx_version=windows_fx, slot=slot)  
File "/usr/local/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 651, in update_site_configs  
return _generic_site_operation(cmd.cli_ctx, resource_group_name, name, 'update_configuration', slot, configs)  
File "/usr/local/lib/python3.6/site-packages/azure/cli/command_modules/appservice/_appservice_utils.py", line 17, in _generic_site_operation  
name, extra_parameter))  
File "/usr/local/lib/python3.6/site-packages/azure/mgmt/web/operations/web_apps_operations.py", line 2996, in update_configuration  
body_content = self._serialize.body(site_config, 'SiteConfigResource')  
File "/usr/local/lib/python3.6/site-packages/msrest/serialization.py", line 580, in body  
return self._serialize(data, data_type, **kwargs)  
File "/usr/local/lib/python3.6/site-packages/msrest/serialization.py", line 452, in _serialize  
target_obj, data_type, **kwargs)  
File "/usr/local/lib/python3.6/site-packages/msrest/serialization.py", line 715, in serialize_data  
return self._serialize(data, **kwargs)  
File "/usr/local/lib/python3.6/site-packages/msrest/serialization.py", line 489, in _serialize  
new_attr = self.serialize_data(orig_attr, attr_desc['type'], **kwargs)  
File "/usr/local/lib/python3.6/site-packages/msrest/serialization.py", line 708, in serialize_data  
data, data_type[1:-1], **kwargs)  
File "/usr/local/lib/python3.6/site-packages/msrest/serialization.py", line 783, in serialize_iter  
serialized.append(self.serialize_data(d, iter_type, **kwargs))  
File "/usr/local/lib/python3.6/site-packages/msrest/serialization.py", line 715, in serialize_data  
return self._serialize(data, **kwargs)  
File "/usr/local/lib/python3.6/site-packages/msrest/serialization.py", line 489, in _serialize  
new_attr = self.serialize_data(orig_attr, attr_desc['type'], **kwargs)  
File "/usr/local/lib/python3.6/site-packages/msrest/serialization.py", line 703, in serialize_data  
return Serializer.serialize_enum(data, enum_obj=enum_type)  
File "/usr/local/lib/python3.6/site-packages/msrest/serialization.py", line 915, in serialize_enum  
raise SerializationError(error.format(attr, enum_obj))  
msrest.exceptions.SerializationError: 'ServiceTag' is not valid value for enum <enum 'IpFilterTag'>  
INFO: Web App URL: [xxx](https://insightstaging-as.azurewebsites.net/)  
? Deployment failed.  
```

I think this error is because I'm using Networking Restrictions using service tags in the AppService, but that version of the CLI doesn't understand those?

If I login and run the same commands on my local CLI it deploys fine. Could it be the base Azure CLI tools are too old? It looks like the image uses 2.0.59 from February 26, 2019 whereas I'm using 2.27.2 locally.  

Any chance a version of the Pipe could be released using the latest Azure CLI tools?


Answers:
author: David Harper
body: Hmm, might have been an Azure blip as it appears to be working now. Hey ho.

I guess the question remains if there is a plan to update the underlying Azure CLI in the docker image?


Tags: azure

bitbucket-pipelines

cloud

container