I'm trying to create an web application with Azure. I'm receiving this error:
Image of the error.
Text of the error:
Template deployment failed. Deployment opertation statuses:
Failed:/subscription/d82232b1-4f78-43-e6c638fbc0/resourceGroups
s/Default-ApplicationInsights-CentralUS/provider/Microsft.Sql/server
s/contactmanager()error(InvalidApiVersionParameter): The api-version
'2.0' is invalid.The api version must be of the following format:
yyyy-MM-dd. This format supports the following suffices:'-preview,
-alpha,-beta,-rc,privatepreview'.
Maybe, you should look into this. Maybe it helps you to clarify the above, especially the "API Management REST API version history" tab
Related
I want to create an Azure "Managed App" definition, in preparation for making an Azure Marketplace offering. I am following these MS instructions, and I had specifically been using this MS example managed app. There were was an error(s) in the documentation, which I posted to the MS team (along with my proposed fixes). Nevertheless, I did get the MS example working!
My next step was to replace the original MS sample deployment bundle...
https://raw.githubusercontent.com/Azure/azure-managedapp-samples/master/Managed%20Application%20Sample%20Packages/201-managed-storage-account/managedstorage.zip
...with my own deployment bundle...
https://github.com/brentarias/azureStaticEmpty/raw/master/baselinepocapp.zip
This didn't work. When issuing the az managedapp definition create command, I received the following error:
(DownloadItemFromBlobFailed) Download of the item from blob at 'https://github.com/brentarias/azureStaticEmpty/raw/master/baselinepocapp.zip' failed due to a failed connection.
Code: DownloadItemFromBlobFailed
Message: Download of the item from blob at 'https://github.com/brentarias/azureStaticEmpty/raw/master/baselinepocapp.zip' failed due to a failed connection.
It makes no sense to have a "connection" error, so I assumed that the REAL error was something inside of my deployment bundle. To test that theory, I copied the original MS sample bundle to a variety of places that I control, including Azure BLOB storage. One example location I placed the copied MS deployment file was here:
https://github.com/brentarias/azureStaticEmpty/raw/master/managedstorage.zip
When using this latter URL, I still received the same "connection" error.
In short, the only way for me to bypass the "connection" error is if I use the original sample MS deployment, from the original path that MS supplied. Incidentally, I also tried a variant URL of the original MS sample:
https://github.com/Azure/azure-managedapp-samples/raw/master/Managed%20Application%20Sample%20Packages/201-managed-storage-account/managedstorage.zip
Suddenly the deployment works! However, that location is still the original MS-owned repo "azure-managedapp-samples". This simply seems to confirm that if the deployment does not come from a MS-owned repo, I am then unable to make the deployment.
What am I doing wrong?
Update 2/3/2023
I finally found a way to make this work! When using an Azure storage account, simply having a publicly visible URL for the deployment bundle is insufficient. I need to have a "shared access signature" URL for that deployment bundle...and then the az managedapp definition create command works!
However, my overall question still is unanswered:
What are the valid file-share platforms that the az managedapp definition create supports? Besides github and Azure BLOB, what else?
What exact configuration do I need to make with a github raw link, before it is considered "kosher" by the managedapp definition create?
Prerequisites:
DevTest Lab with Azure Repos connected (as a source for ARM Templates)
working ARM template
Custom images in that DTLab
You try to deploy an ARM template and all deployments fail with error:
Please note, that the mentioned in error message snapshot ("mshasstupiderrors") is not mentioned in ARM template (in my case, I've used only standard Windows Server 2019).
The fix is to check if there is a custom image in that DTLab with the name "mshasstupiderrors" which is missing a connected snapshot.
This post is triggered by 7 months of support case battle with MS - they agreed that this an issue (ARM template deployment validation?), but were not able to find a reason asked to close the ticket...
I have a release setup that I'm trying get out through Azure Devops release pipelines. This is based on another release that I've cloned and works fine.
The issue is that the template is failing a validation check and not going any further. Strange thing is i'm able to check the syntax successfully with new-AzResourceGroupDeployment and test-AzResourceGroupDeployment. It reports no errors and has been deploying fine.
Using Azure Devops release the error coming back is:
2020-02-26T12:26:16.2632844Z ==============================================================================
2020-02-26T12:26:16.2633634Z Task : ARM template deployment
2020-02-26T12:26:16.2634204Z Description : Deploy an Azure Resource Manager (ARM) template to all the deployment scopes
2020-02-26T12:26:16.2634534Z Version : 3.1.19
2020-02-26T12:26:16.2634945Z Author : Microsoft Corporation
2020-02-26T12:26:16.2635504Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment
2020-02-26T12:26:16.2635948Z ==============================================================================
2020-02-26T12:26:16.8677026Z ARM Service Conection deployment scope - Subscription
2020-02-26T12:26:16.8760315Z Checking if the following resource group exists: myResourceGroup.
2020-02-26T12:26:17.2234188Z Resource group exists: true.
2020-02-26T12:26:17.2259290Z Creating deployment parameters.
2020-02-26T12:26:17.2558066Z The detected encoding for file 'd:\a\r1\a\_Azure-Infrastructure\myResourceGroup\deployment\azuredeploy.json' is 'utf-8'
2020-02-26T12:26:17.2561303Z The detected encoding for file 'd:\a\r1\a\_Azure-Infrastructure\myResourceGroup\deployment\param.dev.json' is 'utf-8'
2020-02-26T12:26:17.5304032Z Starting template validation.
2020-02-26T12:26:17.5304834Z Deployment name is Release-vstfs:///ReleaseManagement/Release/95
2020-02-26T12:26:17.5877973Z ##[warning]Validation errors were found in the Azure Resource Manager template. This can potentially cause template deployment to fail. Template validation failed. Error: {"message":"No HTTP resource was found that matches the request URI 'https://management.azure.com/subscriptions/mySubscription/resourcegroups/myResourceGroup/providers/Microsoft.Resources/deployments/Release-vstfs:/ReleaseManagement/Release/95/validate?api-version=2017-05-10'."}.. Please follow https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/template-syntax
2020-02-26T12:26:17.5890527Z Starting Deployment.
2020-02-26T12:26:17.5891348Z Deployment name is Release-vstfs:///ReleaseManagement/Release/95
2020-02-26T12:26:17.6289831Z There were errors in your deployment. Error code: undefined.
2020-02-26T12:26:17.6291819Z ##[error][object Object]
2020-02-26T12:26:17.6295387Z ##[error]Task failed while creating or updating the template deployment.
2020-02-26T12:26:17.6399260Z ##[section]Finishing: ARM Template deployment: Resource Group scope
​Looking the log above, I'm not sure if it's failing on the validation errors or on the error near the end with a undefined error code.
The task is from another subscription and it's listed in the Azure Resource Manager connection on the task and also lists the subscription and the resource groups in the subscription.
Anyone any ideas on how I can get this working or where to start troubleshooting?
your deployment name is:
Release-vstfs:/ReleaseManagement/Release/95
fairly certain that's not allowed (/). so you need to set your deployment name to something reasonable.
ps. : might not be allowed as well
Did you look at the Activity Log in Azure portal?
All deployment attempts are logged here. Look in particular at the JSON pane, often the real issue is only displayed here.
Otherwise, if it doesn't reach Azure, can you double check the service connection in Azure DevOps? (in particular the related user permission in Azure)
Call the api to create an alert in Gov subscription:
ret = await HttpHelper.PutAsync(
new Uri($"https://{app.AzureManagementBaseUri}/subscriptions/{alert["SubscriptionId"]}/" +
$"resourcegroups/{alert["ResourceGroupName"]}/providers/microsoft.insights/" +
$"metricAlerts/{alert["Name"]}?api-version=2017-09-01-preview"),
alertJson, app.AccessToken, cancellationToken).ConfigureAwait(false);
But throws an error:
Error: 'Error while calling 'https://management.usgovcloudapi.net/subscriptions/subid/resourcegroups/ctxwsgs-appinsights/providers/microsoft.insights/alertrules/"alertName"'. StatusCode: BadRequest. Response: '{"code":"ResourceNotSupported","message":"The target resource id '/subscriptions/subid/resourceGroups/ not supported."
The same code works fine for others subscriptions, did I missed some configuration in the gov subscription?
This appears to be a known issue with enabling microsoft.insights in Azure Government. The only way to enable Application Insights via the traditional Add Application Insights Telemetry button in Visual Studio requires a small manual workaround. If you do not use this workaround you will get the error you described.
To mitigate the issue, you must perform these steps:
Switch Visual Studio to target the Azure Government cloud.
Create (or if already existing set) the User Environment variable for AzureGraphApiVersion as follows: (To create a User Environment variable go to Control Panel > System > Advanced system settings > Advanced > Environment Variables.)
Variable name: AzureGraphApiVersion Variable value: 2014-04-01
Make the appropriate Application Insights SDK endpoint modifications for either ASP.NET or ASP.NET Core depending on your project type.
Source: https://learn.microsoft.com/en-us/azure/azure-government/documentation-government-services-monitoringandmanagement
I am trying to build a very simple Azure Resource Manager template to provision an App Service Plan, a Web App and immediately deploy package there using MSDeploy. I created a Resource Group project in Visual Studio and added Web App and MSDeploy extension. I basically followed this article: http://blogs.technet.com/b/georgewallace/archive/2015/05/10/deploying-a-website-with-content-through-visual-studio-with-resource-groups.aspx. I haven't customized deployment PowerShell script which comes with the project.
Here is the template: http://pastebin.com/raw/aFsMyg1W
Everything looks like it should work (package is uploaded to blob, web app is created), but deployment fails with message:
Resource Microsoft.Web/sites/extensions 'xg-test-webapp5/MSDeploy' failed with message 'The resource operation completed with terminal provisioning state 'Failed'.
There is an error message accessible via Kudu console (LogFiles/SiteExtensions/MSDeploy/appManagerLog.xml):
AppGallery Deploy Failed: 'Microsoft.WindowsAzure.StorageClient.StorageClientException: The value for one of the HTTP headers is not in the correct format
Full log:
Just for the reference, here is the content of the blob where the package was uploaded. It can be seen that it is accessible at the correct URL.
Any idea what is happening? Thanks
In your ARM template, the packageUri property for the MSDeploy extension resource is the concatenation of parameters: _artifactsLocation, webdeployPackageFolder and _artifactsLocationSasToken.
I tested your actual web deploy package blob Uri below.
https://xgartifacts.blob.core.windows.net/xg-test-rg-stageartifacts/deploy/package.zip
It is a publicly accessible blob, which means it can be downloaded without the SAS token.
Hence, you should not include the SAS Token in the packageUri property of your ARM template.
Hope this helps!
"packageUri": "[concat(parameters('_artifactsLocation'), '/', parameters('webdeployPackageFolder'), '/', parameters('webdeployPackageFileName'), parameters('_artifactsLocationSasToken'))]"