question

Alchemist-9197 avatar image
0 Votes"
Alchemist-9197 asked MayankBargali-MSFT edited

Unable to Deploy ARM templates | Bad Request error

Trying to deploy ARM templates of APIM using CI/CD pipeline and extractor https://github.com/Azure/azure-api-management-devops-resource-kit/blob/master/src/APIM_ARMTemplate/README.md#extractor tool.

Trying to deploy the master template and using extractor as given below.

 apimtemplate extract 
 --sourceApimName <Name of source APIM> 
 --destinationApimName <Name of destination APIM> 
 --resourceGroup <Resource Group Name> 
 --fileFolder <Name of folder> 
 --linkedTemplatesBaseUrl <Path to extracted templates> 
 --policyXMLBaseUrl https://xxxxxx.blob.core.windows.net/xxxxxx


So, while validating and deploying ARM templates using CI/CD getting the below error.

 ##[error]Multiple error occurred: BadRequest,BadRequest,BadRequest,BadRequest,BadRequest,BadRequest,BadRequest. Please see details.
 ##[error]Details:
 ##[error]InvalidContentLink: The provided content link 'Microsoft.WindowsAzure.ResourceStack.Frontdoor.Data.Entities.Deployments.DeploymentTemplateContentLink' is invalid or not supported. Content link must be an absolute URI not referencing local host or UNC path.
 ##[error]InvalidContentLink: The provided content link 'Microsoft.WindowsAzure.ResourceStack.Frontdoor.Data.Entities.Deployments.DeploymentTemplateContentLink' is invalid or not supported. Content link must be an absolute URI not referencing local host or UNC path.
 ##[error]InvalidContentLink: The provided content link 'Microsoft.WindowsAzure.ResourceStack.Frontdoor.Data.Entities.Deployments.DeploymentTemplateContentLink' is invalid or not supported. Content link must be an absolute URI not referencing local host or UNC path.
 ##[error]InvalidContentLink: The provided content link 'Microsoft.WindowsAzure.ResourceStack.Frontdoor.Data.Entities.Deployments.DeploymentTemplateContentLink' is invalid or not supported. Content link must be an absolute URI not referencing local host or UNC path.
 ##[error]InvalidContentLink: The provided content link 'Microsoft.WindowsAzure.ResourceStack.Frontdoor.Data.Entities.Deployments.DeploymentTemplateContentLink' is invalid or not supported. Content link must be an absolute URI not referencing local host or UNC path.
 ##[error]InvalidContentLink: The provided content link 'Microsoft.WindowsAzure.ResourceStack.Frontdoor.Data.Entities.Deployments.DeploymentTemplateContentLink' is invalid or not supported. Content link must be an absolute URI not referencing local host or UNC path.
 ##[error]InvalidContentLink: The provided content link 'Microsoft.WindowsAzure.ResourceStack.Frontdoor.Data.Entities.Deployments.DeploymentTemplateContentLink' is invalid or not supported. Content link must be an absolute URI not referencing local host or UNC path.



Getting this error because of this --policyXMLBaseUrl https://xxxxxx.blob.core.windows.net/xxxxxx tag.

As far as I checked a URL to policies folder must be provided. I am also doing the same. So please help me with this error.

Thanks in advance.





azure-api-management
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MayankBargali-MSFT avatar image
1 Vote"
MayankBargali-MSFT answered MayankBargali-MSFT edited

@Alchemist-9197 Can you confirm if --linkedTemplatesBaseUrl has the URL Location (not local path) that stores linked templates. I can see that you have specified --policyXMLBaseUrl as the blob path. As per the error message it looks like your ARM template that you are deploying might have reference from the local path.

· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

no, --linkedTemplatesBaseUrl has local path (${System,DefaultWorkingDirectory}) that stores linked templates. Changed to a URL location, and now it is running. But it is not downloading templates from that path while deploying.

0 Votes 0 ·

@Alchemist-9197 Thanks for the update. Can you confirm if the URL path is publicly accessible and if you are using the storage URL then have you passed the SAS URL so it authenticate the request?

0 Votes 0 ·

Thanks for the prompt response and Yes I am using a SAS URL.

0 Votes 0 ·
Show more comments