struggling to get 'deploy to azure button' to work - azure

I'm struggling to get a Deploy to Azure button to work and hoping someone can help,
my code in the readme.md looks like
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/<url encoded link to raw template>
when I try the button it takes me to the deploy screen, only I get an error:
"(x) Error parsing template. Please ensure template is valid JSON. Invalid symbol at character position 4. (3 other errors)"
the template validates and works as expected when deployed manually through Deploy a Custom Template,
the raw uri to the template in our tfsgit repo returns the raw template as expected
(the raw uri uses msoft's pattern of https://dev.azure.com/{{organization}}/{{project}}/_apis/sourceProviders/{{providerName}}/filecontents?repository={{repository}}&path={{path}}&commitOrBranch={{commitOrBranch}}&api-version=5.0-preview.1)
I'm guessing might be some kind of authentification issue, I've tried basic auth with username:password#https://... or maybe it only works with github.com, either way I'm completely stuck
nothing I try seems to work, and azure won't show me the json it's trying to parse,
I was wondering if someone else has had a similar issue and would be able to point me in the right direction here
thanks in advance

Related

Swagger error in Office 365/Outlook step in Logic App

this seems really weird and I'm not sure how to fix. Any tips would be appreciated.
I have an Office 365 Outlook step called Send An Email (V2). When I add this directly to the logic app, it works fine. When I export the template and deploy from visual studio, I get this error from that step:
Error in Swagger definition SyntaxError: The object is not a valid Swagger API definition
Does anyone know why this would be? All the other steps I'm deploying like this work fine.
Also, an alternative for sending email would be fine.

Azure ARM Template Testing with Pester

I have been following the link
Azure ARM Template Testing on how to carry out ARM testing with Pester.
Unfortunately, I'm unable to get a successful tests.
For example in the script the following code states the following:
It "Does Availability Set Have Correct SKU" {
$av = $deploymentOutput.validatedResources | Where-Object { $_.type -eq 'Microsoft.Compute/availabilitySets' }
$av.sku.name | Should Be **'Align'**
However, even though the result of the ARM template is 'Align' I get the following error.
error
Whereas I should be getting the following successful output:
success
For a complete look at the code it can be found here
Any guidance will greatly appreciated.
Regards
While this isnt a direct answer to your question, this is an indirect answer to your question :)
Just dont do this. Test-AzureRMResourceGroupDeployment doesnt do any real good. If you insist on using it you can always use a 1 liner to do that or use VSCode tasks or whatever to kick off this cough test cough.
There is really no point in validating if this particular resource type is the one that you expect, because you dont really change resource types in the resource after you created it. Also, if Test-AzureRMResourceGroupDeployment returns success doesnt mean your deployment will work. It only checks basic sanity. Just create a powershell script\task to deploy a template and kick it off automatically after commit. Pester adds nothing of value to this process, only complicates things.

Azure API Management - Optional Parameters

I'm trying to work with optional Query parameters. But when I try to access this parameter in my body mapping to my backend SOAP service, I get no results.
I defined the parameter like this.
And I'm trying to access it in my Liquid template with this code.
{{context.Request.Url.Query.GetValueOrDefault("test","false")}}
But the result is just empty. Could somebody help me to find what I'm doing wrong here?
Try using context.Request.OriginalUrl instead. OriginalUrl is what comes into the Gateway. context.Request.Url is after it has been rewritten for the backend.

What is the Azure API version

I'm trying to access the result of a GET request provided by Azure, as shown in the example : https://msdn.microsoft.com/sv-se/library/azure/dn820159.aspx
My problem is that the api-version is a mandatory argument, but I have no idea about what to write inside. I'm a bit lost with the Azure Batch documentation, it doesn't seem to be complete.
I found something in an Azure webpage : https://azure.microsoft.com/en-us/documentation/articles/search-api-versions/ and the api-version was api-version=2015-02-28. However, if I try it in my browser, I have this answer : "key":"Reason","value":"The specified api version string is invalid".
Any idea of what I can put inside the api-version parameter ?
Have a look here
As the time of this writing
The version of the Batch API described here is '2016-07-01.3.1', and
using that version is recommended where possible.
Earlier versions include '2016-02-01.3.0', '2015-12-01.2.1',
'2015-11-01.2.1', '2015-06-01.2.0', '2015-03-01.1.1', and
'2014-10-01.1.0'.
So try specifying '2016-07-01.3.1'

Mapping URL in Maximo Anywhere

I'm looking to deploy mapping functionality in the Work Execution app within the Maximo Anywhere framework. The issue I'm having is the app throws an error when I attempt to go into the "Map of Work Orders" screen. The error that displays on the screen is
"Unable to show map. It is possible that the value for the providerURL property is invalid. Contact your administrator."
When I look into the logging data I get a bunch of lines about OpenLayersMap.js - stating that the providerURL is wrong.
In the app.xml for the WorkExecution app we have this configured in the Map tag (line 3320 in our config)
<map adjustToTop="true" androidLocalMapUrl="file://mnt/sdcard/basemaps/Manhattan.tpk" id="WorkExecution.MapView_esri_true" iosLocalMapUrl="Manhattan.tpk" iosMapAccessMethod="useDocumentsFolder" layoutInsertAt="map" provider="esri" workOfflineResource="workOrder" providerUrl="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}"/>
Additionally, we've enabled maps in the app-feature.properties file by setting map.enabled=true
Does anyone have online maps working in a test environment on 7.5.2 in the work execution app? If so, mind sharing their config if it hits a public server, or point out what's wrong with ours?
This message inform you that the value for providerUrl is invalid or that this connection to the server could not be achieved. I checked here and it seems that this value is correct.
Are you using the adminmode? Because internally, the value for providerUrl from app.xml can be replaced by the value of providerUrl from the server via adminmode (maximo). To check if you are using it, take a look at your worklight.properties file and if the property for si.adminmode is true, you need to confirm if the value put on maximo to providerUrl is a valid one.

Resources