Skip to content

Example of create new apim backend with header value that points at named value #19073

Answered by RobBowman
RobBowman asked this question in Q&A
Discussion options

You must be logged in to vote

After exporting the apim instance to an arm template via the portal, I was better able to understand the data the PowerShell was expecting. The following code works ok:

$backend = Get-AzApiManagementBackend -Context $context -BackendId "func-365response"
if (-not($backend)) {
  $headers = @{}
  $headers.add("x-functions-key", @($nvFuncKey.Name))
  $credential = New-AzApiManagementBackendCredential -Header $headers 
  $funcApp = Get-AzResource -Name "func-365response-$env-001"
  $backend = New-AzApiManagementBackend -Context $context -BackendId "func-365response" `
    -ResourceId "https://management.azure.com/$funcApp.ResourceId" -Credential $credential `
    -Protocol http -url "https://…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RobBowman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant