microsoft / azure-api-management-monetization

MIT License
54 stars 30 forks source link

When running the Stripe Initialization script, get Error "Invalid URI: The hostname could not be parsed." when copying the correct URLs and running on Azure CLI. #28

Closed Rob97 closed 2 years ago

Rob97 commented 2 years ago

Invoke-WebRequest: /home/sohrab/stripeInitialisation.ps1:76 Line | 76 | … ionModels = Invoke-WebRequest -Uri $ApimGatewayUrl/billing/monetizati … | ~~~~~~~~~~~~~ | Invalid URI: The hostname could not be parsed.

Rob97 commented 2 years ago

Solved!

Documentation suggests the following:

./payment/stripeInitialisation.ps1 -StripeApiKey "<the 'Initialization Key' API key (see pre-requisites)>" -ApimGatewayUrl "<the gateway URL of the APIM service - can find in Azure Portal>" -ApimSubscriptionKey "<the primary key for the Built-in all-access subscription in APIM - can find in Azure Portal>" -StripeWebhookUrl "/webhook/stripe" -AppServiceResourceGroup "<the name of the resource group containing the billing portal App Service>" -AppServiceName ""

But the double quotes need to be removed when entering for the AZURE Powershell only otherwise the APIMGatewayUrl cannot be parsed. So it would be like this:

./payment/stripeInitialisation.ps1 -StripeApiKey <the 'Initialization Key' API key (see pre-requisites)> -ApimGatewayUrl <the gateway URL of the APIM service - can find in Azure Portal> -ApimSubscriptionKey <the primary key for the Built-in all-access subscription in APIM - can find in Azure Portal> -StripeWebhookUrl /webhook/stripe -AppServiceResourceGroup <the name of the resource group containing the billing portal App Service> -AppServiceName