diff --git a/Dockerfile b/Dockerfile index 44bcb24..88263ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/azure-cli +FROM mcr.microsoft.com/azure-cli:2.64.0 ARG TARGETARCH diff --git a/README.md b/README.md index 959f515..58be228 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,22 @@ Console.WriteLine("Created Queue: " + queue.Name); > [!NOTE] > As the example demonstrates, the subscription id is provided as the bearer token for authentication. The subscription will always be created automatically if one does not yet exist. +## Use a custom domain + +You can use your own domain and certificates. Generate a certificate for your domain and expose the private and public keys in a json file. The json must contains the keys in PEM format like the following: + +```json +{ + "cert": "-----BEGIN CERTIFICATE-----\n[REDACTED....]\n-----END CERTIFICATE-----", + "key": "-----BEGIN PRIVATE KEY-----\n[REDACTED....]\n-----END PRIVATE KEY-----" +} +``` + +Then, start the container with two additional environment variables + +- `LOCALSANDBOX_HOSTNAME`: fully qualified domain name (FQDN) of your custom domain. Default value is `localhost.localsandbox.sh`. +- `LOCALSANDBOX_CERT_RETRIEVAL_URL`: URL where the JSON file containing the certificate and key can be retrieved (could be hosted anywhere). Default value is `https://cert.localsandbox.sh/`. + ## Features and Roadmap - [ ] Service Bus diff --git a/packages/azure-local-cli/azure_local_cli/__main__.py b/packages/azure-local-cli/azure_local_cli/__main__.py index db92d98..09028e2 100644 --- a/packages/azure-local-cli/azure_local_cli/__main__.py +++ b/packages/azure-local-cli/azure_local_cli/__main__.py @@ -11,7 +11,7 @@ def __setattr__(self, key, value): import os port = int(os.environ.get("LOCALSANDBOX_PORT") or 7329) -hostname = f"localhost.localsandbox.sh" +hostname = os.environ.get("LOCALSANDBOX_HOSTNAME") or "localhost.localsandbox.sh" endpoint = f"https://{hostname}:{port}/azure" import azure.cli.core as azure_cli_core