Skip to content

Commit d291641

Browse files
author
Simon Jakesch
committed
fixing pivot issues with code tabs and look when using them as if/else
1 parent 388991d commit d291641

File tree

2 files changed

+76
-32
lines changed

2 files changed

+76
-32
lines changed

articles/container-apps/quickstart-code-to-cloud.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Download and extract the API sample application in the language of your choice.
144144

145145
# [C#](#tab/csharp)
146146

147-
[Download the source code](https://codeload.github.com/azure-samples/containerapps-albumapi-csharp/zip/refs/heads/main) from the [azure-samples/containerapps-albumapi-csharp repo](https://github.com/azure-samples/containerapps-albumapi-csharp).
147+
[Download the source code](https://codeload.github.com/azure-samples/containerapps-albumapi-csharp/zip/refs/heads/main) to your machine.
148148

149149
Extract the download and change into the *containerapps-albumapi-csharp-main/src* folder.
150150

@@ -155,9 +155,6 @@ Extract the download and change into the *containerapps-albumapi-csharp-main/src
155155

156156
Extract the download and change into the *containerapps-albumapi-java-main/src* folder.
157157

158-
> [!NOTE]
159-
> The Java sample only supports a Maven build, which creates an executable JAR file. The build uses the default settings, as passing in environment variables is not supported.
160-
161158

162159
# [JavaScript](#tab/javascript)
163160

@@ -175,9 +172,9 @@ Extract the download and change into the *containerapps-albumapi-python-main/src
175172

176173
# [Go](#tab/go)
177174

178-
[Download the source code](https://codeload.github.com/azure-samples/containerapps-albumapi-go/zip/refs/heads/main) from the [azure-samples/containerapps-albumapi-csharp repo](https://github.com/azure-samples/containerapps-albumapi-go).
175+
[Download the source code](https://codeload.github.com/azure-samples/containerapps-albumapi-go/zip/refs/heads/main) to your machine.
179176

180-
Extract the download and navigate into the `containerapps-albumapi-go-main/src` directory and proceed to the next step.
177+
Extract the download and navigate into the *containerapps-albumapi-go-main/src* folder.
181178

182179

183180
::: zone-end
@@ -217,7 +214,7 @@ Extract the download and navigate into the `containerapps-albumapi-python-buildp
217214

218215
# [Go](#tab/go)
219216

220-
Azure Container Apps cloud build doesn't support Buildpacks for Go.
217+
Azure Container Apps cloud build doesn't currently support Buildpacks for Go.
221218

222219
::: zone-end
223220

@@ -230,19 +227,22 @@ Azure Container Apps cloud build doesn't support Buildpacks for Go.
230227

231228
Build and deploy your first container app with the `containerapp up` command. This command will:
232229

233-
- Create the resource group
234230
::: zone pivot="with-dockerfile"
231+
- Create the resource group
235232
- Create an Azure Container Registry
236233
- Build the container image and push it to the registry
234+
- Create the Container Apps environment with a Log Analytics workspace
235+
- Create and deploy the container app using the built container image
237236
::: zone-end
237+
238238
::: zone pivot="without-dockerfile"
239-
- Automatically create a default registry as part of your environment
240-
- Automatically detect the language and runtime
241-
- Build the image using the appropriate Buildpack
239+
- Create the resource group
240+
- Create a default registry as part of your environment
241+
- Detect the language and runtime of your application and build the image using the appropuiate Buildpack
242242
- Push the image into the Azure Container Apps default registry
243-
::: zone-end
244243
- Create the Container Apps environment with a Log Analytics workspace
245-
- Create and deploy the container app using the build container image
244+
- Create and deploy the container app using the built container image
245+
::: zone-end
246246

247247
::: zone pivot="with-dockerfile"
248248

@@ -251,7 +251,7 @@ The `up` command uses the Dockerfile in the root of the repository to build the
251251
::: zone-end
252252
::: zone pivot="without-dockerfile"
253253

254-
If the `up` command doesn't find a Dockerfile, it automatically uses Buildpacks to turn your application source into a runnable container. Since the Buildpack is trying to run the build on your behalf, you need to tell the `up` command which port to use.
254+
If the `up` command doesn't find a Dockerfile, it automatically uses Buildpacks to turn your application source into a runnable container. Since the Buildpack is trying to run the build on your behalf, you need to tell the `up` command which port to send ingress traffic to.
255255

256256
::: zone-end
257257

articles/container-apps/quickstart-repo-to-cloud.md

Lines changed: 62 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -169,81 +169,122 @@ $ACR_NAME="acaalbums"+$GITHUB_USERNAME
169169

170170
## Prepare the GitHub repository
171171

172-
In a browser window, go to the GitHub repository for your preferred language and fork the repository.
172+
::: zone pivot="with-dockerfile"
173+
174+
In a browser window, go to the GitHub repository for your preferred language and fork the repository.
173175

174176
# [C#](#tab/csharp)
175177

176-
Select the **Fork** button at the top of the [album API repo](https://github.com/azure-samples/containerapps-albumapi-csharp) to fork the repo to your account.
178+
Select the **Fork** button at the top of the [album API repo](https://github.com/azure-samples/containerapps-albumapi-csharp) to fork the repo to your account. Then copy the repo URL to use it
179+
in the next step.
180+
181+
182+
# [Java](#tab/java)
183+
184+
Select the **Fork** button at the top of the [album API repo](https://github.com/azure-samples/containerapps-albumapi-java) to fork the repo to your account. Then copy the repo URL to use it
185+
in the next step.
186+
187+
188+
# [JavaScript](#tab/javascript)
189+
190+
Select the **Fork** button at the top of the [album API repo](https://github.com/azure-samples/containerapps-albumapi-javascript) to fork the repo to your account. Then copy the repo URL to use it
191+
in the next step.
192+
193+
194+
# [Python](#tab/python)
195+
196+
Select the **Fork** button at the top of the [album API repo](https://github.com/azure-samples/containerapps-albumapi-python) to fork the repo to your account. Then copy the repo URL to use it
197+
in the next step.
198+
199+
200+
# [Go](#tab/go)
201+
202+
Select the **Fork** button at the top of the [album API repo](https://github.com/azure-samples/containerapps-albumapi-go) to fork the repo to your account. Then copy the repo URL to use it
203+
in the next step.
204+
205+
::: zone-end
177206

178207

179208
::: zone pivot="without-dockerfile"
180209

181-
# [Java](#tab/java)
210+
In a browser window, go to the GitHub repository for your preferred language and fork the repository **including branches**.
211+
212+
# [C#](#tab/csharp)
182213

183-
Select the **Fork** button at the top of the [album API repo](https://github.com/azure-samples/containerapps-albumapi-java) to fork the repo to your account.
214+
Select the **Fork** button at the top of the [album API repo](https://github.com/azure-samples/containerapps-albumapi-csharp) to fork the repo to your account. Uncheck "Copy the `main` branch only"
215+
to also fork the `buildpack` branch.
184216

185-
> [!NOTE]
186-
> The Java sample only supports a Maven build, which results in an executable JAR file. The build uses the default settings, as passing in environment variables is not supported.
187217

188-
:::zone-end
218+
# [Java](#tab/java)
219+
220+
Select the **Fork** button at the top of the [album API repo](https://github.com/azure-samples/containerapps-albumapi-java) to fork the repo to your account. Uncheck "Copy the `main` branch only"
221+
to also fork the `buildpack` branch.
189222

190223

191224
# [JavaScript](#tab/javascript)
192225

193-
Select the **Fork** button at the top of the [album API repo](https://github.com/azure-samples/containerapps-albumapi-javascript) to fork the repo to your account.
226+
Select the **Fork** button at the top of the [album API repo](https://github.com/azure-samples/containerapps-albumapi-javascript) to fork the repo to your account. Uncheck "Copy the `main` branch only"
227+
to also fork the `buildpack` branch.
194228

195229

196230
# [Python](#tab/python)
197231

198-
Select the **Fork** button at the top of the [album API repo](https://github.com/azure-samples/containerapps-albumapi-python) to fork the repo to your account.
199-
232+
Select the **Fork** button at the top of the [album API repo](https://github.com/azure-samples/containerapps-albumapi-python) to fork the repo to your account. Uncheck "Copy the `main` branch only"
233+
to also fork the `buildpack` branch.
200234

201-
::: zone pivot="with-dockerfile"
202235

203236
# [Go](#tab/go)
204237

205-
Select the **Fork** button at the top of the [album API repo](https://github.com/azure-samples/containerapps-albumapi-go) to fork the repo to your account.
238+
Azure Container Apps cloud build doesn't currently support Buildpacks for Go.
206239

207240
::: zone-end
208241

242+
209243
---
210244

211245
## Build and deploy the container app
212246

213247
Build and deploy your first container app from your forked GitHub repository with the `containerapp up` command. This command will:
214248

249+
::: zone pivot="with-dockerfile"
215250
- Create the resource group
216251
- Create the Container Apps environment with a Log Analytics workspace
217-
::: zone pivot="with-dockerfile"
218252
- Create an Azure Container Registry
253+
- Create a GitHub Action workflow to build and deploy the container app
219254
::: zone-end
255+
220256
::: zone pivot="without-dockerfile"
257+
- Create the resource group
258+
- Create the Container Apps environment with a Log Analytics workspace
221259
- Automatically create a default registry as part of your environment
222-
::: zone-end
223260
- Create a GitHub Action workflow to build and deploy the container app
261+
::: zone-end
224262

225263
When you push new code to the repository, the GitHub Action will:
226264

227265
::: zone pivot="with-dockerfile"
228266
- Build the container image and push it to the Azure Container Registry
229267
- Deploy the container image to the created container app
268+
269+
The `up` command uses the Dockerfile in the root of the repository to build the container image. The target port is defined by the EXPOSE instruction in the Dockerfile. A Docker file isn't required to build a container app.
230270
::: zone-end
271+
231272
::: zone pivot="without-dockerfile"
232273
- Automatically detect the language and runtime
233274
- Build the image using the appropriate Buildpack
234275
- Push the image into the Azure Container Apps default registry
276+
277+
The container app needs to be accessible to ingress traffic. Ensure to expose port 8080 to listen for incoming requests.
235278
::: zone-end
236279

237280
::: zone pivot="with-dockerfile"
238-
The `up` command uses the Dockerfile in the root of the repository to build the container image. The target port is defined by the EXPOSE instruction in the Dockerfile. A Docker file isn't required to build a container app.
281+
In the command below, replace the `<YOUR_GITHUB_REPOSITORY_NAME>` with your GitHub repository name in the form of `https://github.com/<OWNER>/<REPOSITORY-NAME>` or `<OWNER>/<REPOSITORY-NAME>`.
239282
::: zone-end
240283

241284
::: zone pivot="without-dockerfile"
242-
The container app needs to be accessible to ingress traffic. Ensure to expose port 8080 to listen for incoming requests.
285+
In the command below, replace the `<YOUR_GITHUB_REPOSITORY_NAME>` with your GitHub repository name in the form of `https://github.com/<OWNER>/<REPOSITORY-NAME>` or `<OWNER>/<REPOSITORY-NAME>`. Use the `--branch buildpack` option to point to the sample source without a Dockerfile.
243286
::: zone-end
244287

245-
In the command below, replace the `<YOUR_GITHUB_REPOSITORY_NAME>` with your GitHub repository name in the form of `https://github.com/<OWNER>/<REPOSITORY-NAME>` or `<OWNER>/<REPOSITORY-NAME>`.
246-
247288
# [Bash](#tab/bash)
248289

249290
::: zone pivot="with-dockerfile"
@@ -271,6 +312,8 @@ az containerapp up \
271312
--ingress external \
272313
--target-port 8080 \
273314
--repo <YOUR_GITHUB_REPOSITORY_NAME>
315+
--branch buildpack
316+
--
274317
```
275318

276319
::: zone-end
@@ -303,6 +346,7 @@ az containerapp up `
303346
--ingress external `
304347
--target-port 8080 `
305348
--repo <YOUR_GITHUB_REPOSITORY_NAME>
349+
--branch buildpack
306350
```
307351

308352
::: zone-end

0 commit comments

Comments
 (0)